home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Diamond Collection
/
The Diamond Collection (Software Vault)(Digital Impact).ISO
/
cdr28
/
todir22.zip
/
TO.DOC
< prev
Wrap
Text File
|
1993-01-04
|
28KB
|
549 lines
TO - Version Two-point-zero Andrea Steffanoni, et all
This is a great little utility for moving around to different
subdirectories on your hard disk. Andrea Steffanoni wrote the
original program and evidently it has been thru several people's
hands since. Tim Frost has made many changes in the direction
of making this program more robust and cleaning up the source
code. I fixed a couple of bugs, made it run a little faster and
added approximate string matching in the directory search.
old---------------------------------------------------------news
*** RELEASES 1.2 - NEWS ***
new---------------------------------------------------------news
A big thank to Edoardo Mecchina.
Edoardo has discovered the method used by Peter Norton's NCD to
compute the non-standard CRC put at the end of the TREEINFO
file, thus eliminating a little incompatibility between TO and
NCD. From this version the TREEINFO file created by TO is
totally compatible with Peter Norton's NCD, and you can share it
between the two programs without any trouble.
At the moment I can't see any possible improvement to the
program's capabilities, but if you discover one, please let me
know and, if possible, I will add it. Leave me a message on
Amnesia (Varese) or Ipotesi (Milano).
Thanks again to Edoardo.
no----------------------------------------------------------news
*** RELEASES 1.1 - NEWS ***
good--------------------------------------------------------news
First good news: no bugs found till now! Hope it will continue.
Second good news; two more flags. The -r (Record) and -p (Pop)
flags are now available to record the directory you are in for
future popping. See the Flag Section to get information about
their use.
First-and-only bad news: LACK OF POSTCARDS! This is a totally
free program, has a good documentation, the source code is
available, should also be useful, so you can spend five minute
of your life just to say 'Thanks' to me. I've also others ideas,
but if I have no feedback from you, why should I share them with
you? So, reader, if YOU like TO, give me a sign of your
presence; I will appreciate it a lot.
t--------------------------------------------------------------o
Hello, everybody!
I'm happy to SHARE this program with you and with all other guys
of the big shareware group. I hope you enjoy this little
program. It's nothing special, but it save you from typing a
lots of keys just to switch to deep-nested directory. It also
help you to quickly find a directory if you don't remember its
exact name or its location on your directory tree without having
to look through the whole tree. And finally, you can use it
also to find duplicate directory names.
But before starting, let me express my >THANKS<.
First of all, a *BIG* thank to all the BBS Sysops, which support
with their activities the shareware group.
Then, a *HUGE* thank to all people of the shareware group. I'm
using a lot of really good pieces of software which have
strongly increased both my experience and my productivity. Now
it's my turn to contribute. I hope you will appreciate this
little job of mine at least half half half half half half much I
appreciate yours. And again, thanks, thanks, thanks!
Then, a bit of advertisement (dedicated to YOU). I just want to
make you think a moment on the shareware concept. In my
experience, I've learned *LOTS* from other people works, and
more, I use for my job really professional software tools. In
the shareware group I have found programs, ideas, tips and
tricks, suggestions, even precious book titles. All at the cost
of a phone call, or just few dollar$ if asked from the authors.
And about them? I'm sure they are happy knowing someone else is
enjoying their contributions. So am I for you.
In fact, software is an idea, and if both me and you have one
idea, and we share our ideas, we end up having two ideas each.
And if we are not just two but some thousands people, all
sharing their ideas and their experience, we all end up having a
tremendous number of ideas.
So, for the moment enjoy my little idea, but don't keep yours
just for you, share them with everybody. For small that they can
be, there will be someone who will appreciate them and will be
grateful to you.
Ok, that's enough. Let's talk about TO.
high-------------------------------------------------------story
*** THE HI-STORY AND THE LO-STORY OF TO ***
low--------------------------------------------------------story
Are you interested in a bit of history? I'll tell you how TO
came in my mind.
You have to know, that I'm a very -lazy- programmer. And when I
say lazy, I mean *really* lazy. I like a lot programming, but I
don't like at all using the keyboard. Too many keys, my fingers
always jumping up and down, left and right, and all the mistakes
I made! Pfffffffft! How boring!
Well, you might say, no keyboard no programming, and you'll be
right. So, since I like programming, I've been thinking a lot to
all the tricks I could use to reduce my use of the keyboard.
First step, was KBFIX2. This little program (shareware, of
course) increases my keyboard speed and set up a +Useful+ buffer
of 150 bytes. Not enough, of course.
Then, after using some others similar programs, I've discovered
RETRIEVE. This program combine the capabilities of edit the Dos
command line in a better way then Dos, recall and edit previous
command line(s), set aliases (e.g. t for type, saving me 3 keys
on 4, or better, px for pkxunpak *.arc<return>, 3 keys instead
of 15), and assign strings to function key (e.g. F1 is
c:<return>dir /p<return>, 1 key instead of 10). It's a very
*beautiful* program, better then the most famous Dos-edit or
Ced; I recommend it to you (this is a shareware information,
have you noticed it?).
Next, I've set up my editor with the most useful keyboards
macro. Obviously, I've choose an editor with very short command
sequences, so I can choose nearly any command with few (and very
few) keystrokes. It also supports learn-and-repeat mode, and
(did you guess it?) this is a feature that I use a lot. Curious
about the name? It's QEdit!
Enough? Not yet. I set up a directory in my path containing .bat
files (with very shorts names, of course) for usual command
sequences. An example: WIN.BAT will log to drive D:, change
directory in \WIN, and calls Windows, all at only 4 keystrokes.
And (more? Yes, more) I choose really shorts directory names,
e.g. U for my UTILITIES, PC for Procomm Plus and so on. This is
useful for the CD and the COPY command.
So, at this point I should have been happy, didn't I?. Yes,
indeed I have been, for a while. All the commands at a few
keystrokes. What a paradise! I still had to 'keyboard' a lot
while programming, but ok, programming itself is so beautiful
for me that I don't bother.
|
\ /
> BUT <
/ \
|
I'm not only lazy, I'm also very ordered, at least inside my
computer (in fact, my girl-friend won't agree on this point, she
sees only the rest). Order means having all my files in the
right place, and this involves a well-structured directory tree.
I have to manage in total something like one thousand two
hundred files, so I end up with more then 100 directories on my
two-drives hard disk.
It's really an ordered disk, but I've discovered that, after all
the work done for improving my productivity on the keyboard, I
was losing a lot of time (and of keystrokes) to change working
directory. Ok, I set up some .bat files for the most used, but
what about the others? It was annoying me to have to provide the
full path name every time. I had to find a better method. So I
tried the Norton Change Directory, but I was not satisfied at
all. I still had to use too many keystrokes, and more, it was an
extra job for me to look at the visual tree. No good!
Well, I said, something has to be done. My first idea was to
provide only the last name of the directory I want to log in,
and let the computer find the whole path for me. To gain speed,
I used the already-built TREEINFO.NCD file (it's built by the
NCD, Norton Change Directory, in the root directory and contains
the directory tree of the drive). So TO was conceived and born.
(Please note the short name of TO - 2 keystrokes only!).
I used it and <*WOW*>, impressing! I liked TO immediately. The
little time spent by the program to scan the TREEINFO file was
largely compensate by the lot of time saved while typing a much
shorter name, and (well, well) I've reduced a byte more my
unproductive interation with the keyboard.
But very soon (nearly after 1 minute of use) I realized I could
have done TO even $BETTER$. As you can guess, not all of my
directory names are short, some of them are 5, 6, 7! or
(¡terrible!) even 8 letters long. Too much. Well, let's make the
program working even on a partial match. Moreover, on my disk I
use sometimes the same name for more than one directory, e.g.
I've three directories called DOC. In case on ambiguity, the
program should allows me to choose the one I want to switch to
(this is done with just one keystroke, as you might have
guessed). So I added this two capabilities to TO. Second
release! $$MUCH MUCH BETTER$$.
But what about my two-drive system? I'm too lazy to spend time
to press the one key (please note 'one') that would me log on
the other drive, if I'm not on the right one. Ok, make TO multi-
drive. And finally, if I don't remember the directory name? Or
if I remember it wrong, and TO can't find it? In this desperate
cases, TO will call the Norton Change Directory to visual the
directory tree. Only on one drive, like NCD works? No, of
course, at least on all the drives. But which drives? And if you
don't own the Norton Utilities? Ok, TO can be instructed from
the command line, but this requires extra keystrokes. No, no,
the minimum I could made was to build a configuration file. And
So I created TO.INI. Another problem: if you don't have the
Norton Utilities you can't create the TREEINFO file; well, let's
TO make the job.
Third and final release! That's it! It's enough for you? Are you
curious to know how TO exactly works? Ok, it's time for a bit of
=doc-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=doc=
D O C U M E N T A T I O N
=doc-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=doc=
Syntax for TO is:
TO [-b][-n][-p][-r][-dlist_of_drives] [[*]dir] [[*]dir] ...
Sounds complicated? Here better instructions.
Dir stands for directory and represents the last directory name
of the path of the directory you want to log in. It can be
entered either in upper or in lowercase letters. Do not use the
backslash in the directory name unless you want to go to the
root directory, in which case the directory name IS the
backslash. You can specify one or more directories. Example:
for directory '\lotus\wks\john\oldstuff'
enter 'TO oldstuff'
(in this ugly case 11 keystrokes pressed instead of 24). Still
too much? Don't worry, directory name can be shortened. Try
enter
'TO old'
It works too! (5 more keystrokes saved) As far as the name is
unambiguous, TO will immediately log the desired directory. You
can also try
'TO o'
but probably TO will find more than one directory starting with
the letter 'o'. Where to go? You decide. TO display the list of
matching directories and waits for your choice.
Please choose one or ESC to abort:
1 - c:\pcplus\opx
2 - c:\lotus\wks\john\oldstuff
3 - c:\master\data\orders
In this case, just press the '2' key.
TO works on this basis:
1) If TO finds only one full match, it will jump to the matched
directory;
2) if TO finds more full matches, they are listed and you
can choose the one you want;
3) if TO finds no fulle match but only one partial match, it
will jump to the matched directory;
4) if no full matches are found but more than one partial match,
they are listed and you make your choice;
5) if no matches are found, and the NCD is not enabled (see
later), the programs abort with a message;
6) if no matches are found, or you don't specify any directory
to search for, and the NCD is enabled, then the NCD.EXE
routine is automatically called from TO.
Needs on-line help. Start TO with '?': TO ?
-to----------------------------------------------------------to-
-------------------OTHERS--(MIS)USES--OF--TO--------------------
-to----------------------------------------------------------to-
Now, you have a little problem. You remember having created
somewhere a directory named 'stuff' or 'stuffold' or maybe
'oldstuff' or perhaps 'ostuff' or something like that. You don't
remember the exact name, but you're quit sure it contains the
string 'stuff'. Where is it? You have no idea. Sure, you can
easily find it with a visual tree routine, but why not to try
with
'TO *stuff'
TO will find it for you, without the need to scroll up and down
on a visual directory tree.
Don't find? Maybe it wasn't 'stuff' something, now you remember
it was 'bin' something, or maybe 'old' something? We will look
at both possibilities at the same time. Enter
'TO *bin *old'
and TO will scan the tree looking for match of both entries.
Need more? You can add up to ten entries. Enough?
Ok. Now you are working in your directory \lotus\wks\budget, and
you are looking for a file. It's not there? How? You were
working at it yesterday and nobody has used your computer. And
you are sure you were in the budget directory. Where is gone?
Then you have a doubt: does my disk have more than one budget
directory? Let's see if it's true:
'TO budget'
Oh, yes, there are TWO budget directories, let me have a look to
the other one; ....; oh, the file is there. Do I perhaps also
have two letters directories? Check it again, Sam!
I'm quite sure you won't ever need to use this capabilities of
TO. But -who knows?- maybe one day...
----------------------------------------------------------------
* You wonder how all that works? The basis is *
----------------------------------------------------------------
\THE
|
|---->TREEINFO
| |
| |---->.NCD
|
|---->FILE
----------------------------------------------------------------
TO bases his searches on a file called TREEINFO.NCD, placed in
the root directory. If you already use the Norton Change
Directory utility (NCD), Advanced Edition, you already have this
file; if not, TO will automatically created it the first time is
used. It will take some seconds, but once made the file will
remain for following uses of TO. The TREEINFO file contains the
directory tree of the disk. If you create, rename or delete
directories, you should update the TREEINFO file either by
deleting it (so TO will rebuilt it automatically) or by using
the -b (Build) flag as described later.
Starting from version 1.2 the TREEINFO file is totally
compatible with the same file created by NCD. Thanks to Edoardo
Mecchina, who has found the method to compute the non-standard
CRC that Peter Norton's NCD put at the end of the file. Starting
from this version, you can share the same TREEINFO file between
TO and NCD.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-F-l-a-g-s-F-l-a-g-s-F-l-a-g-s-F-l-a-g-s-F-l-a-g-s-F-l-a-g-s-F-l
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ok, now let's talk about FLAGS.
~~~~~
Valid flags are b (Build), d (Drives), n (Norton), p (Pop) and r
(Record). They can be entered in upper or lowercase letters, can
be placed before or after the directory name, and must be
preceded by the '-' or the '/' sign. They may also be grouped,
e.g. -bnd, but in this case the d flag must be the last in the
sequence, because it will be followed by the list of desired
drives.
The -b (Built) flag tells TO to build or rebuild the
TREEINFO.NCD file. Use this flag if the file does already exist,
otherwise it's unnecessary; if the file is missing TO will
automatically build it. When to rebuilt the file? Any time you
have created, renamed or removed a directory on the disk.
The -n (Norton) flag tells TO that you want use the NCD in some
particular cases explained later. The NCD.EXE program must be in
path. Also, if you use TO on more than one drive, be sure that
the path to reach NCD.EXE contains also the drive specification
('c:\utilities\norton' is ok, but '\utilities\norton' is not).
This flag can also be automatically set by using the TO.INI file
(see later).
The -d (Drives) flag tells TO that you want the search be
carried out on the drive(s) specified after the d. Drives can be
entered either in upper or lowercase. Example: -dD search only
on drive D:, while -dACD search on drive A:, C: and D:. TO, in
case, will also switch to the correct drive. You can permanently
set the search drive(s) by putting a line in the TO.INI file, as
explained later. However, the -d flag has the precedence on the
TO.INI file, and if you use this flag the TO.INI command will be
ignored. This may be useful for particular search.
The -p (Pop) flag tells TO to chain the last recordered
directory. The complete path is stored in the file TO.INI. Read
in -r flag instruction on use of this flag.
The -r (Record) tells TO to record the actual directory in the
file TO.INI for future popping. If the file TO.INI in the root
directory doesn't exist, it will be created. Recording apply to
all drives specified in the TO.INI file or with the -d flag, so
popping will be enabled on all desired drives. This option is
useful to return to your working directory after the temporarely
use of a program elsewhere stored. I use it for a couple of
programs I need to use on-the-fly; one is my home-written
Phonebook. It's a program which not only manage a little
database of numbers, but also has the ability of using the modem
to compose the number, so I won't consume my fingertips (did I
tell you that I'm very -LAZY-?). What happens is that very often
after a call I have to resume a job. So I use a .BAT file to
call my Phonebook with theese instructions:
TO -r agenda
age
TO -p
This puts me back in the directory I were before the call.
?--------------------------------------------------------------?
The last mystery: the TO.INI FILE
?--------------------------------------------------------------?
The file TO.INI may be created and modified with an editor. It
must reside on the root directory of each drive from where you
will call TO. It's not a must. You can also use TO without this
file. In the file, you can specify two parameters: the Default
Search Drive(s) and the Default Use of NCD.
You can put comments anywhere in the file preceding them with a
semi-colon (;). The only legal command are:
DRIVERS = [list of drives]
NORTON = YES
Spaces can be inserted anywhere in the command lines, as TO will
ignore them. You may put only one or both commands. The list of
drives contains all the default search drive(s), e.g.
DRIVERS = CD
Note that the command NORTON = NO is not legal, and will cause a
warning message from TO.
The command NORTON = YES is equivalents to the use of the -n
flag; it cannot be disabled by the flags.
Instead, the DRIVERS command will be ignored if the -d flag is
used. So if you have set DRIVERS = CD an want to search only on
drive A:, use TO with the -dA flag.
If you see a line with the command LASTDIR = <directory>, it has
been added by the use of the -r (Record) flag.
Remember, you have to put a TO.INI file on the root directory of
EACH drive from where you will use TO.
-Home-----------------------------------------------------Pg-Up-
**END** (it was time!)
-END-ENd-End-end------------------------------------------Pg-Dn-
That's All Folks!
If you have read till now you should be impatient to try TO. Do
it now, then read the rest!
Did you like it? I know it's nothing special, but please, give
me some satisfaction.
I also enclose the source code, 100% pure Microsoft C. I've
compiled TO with MSC Compiler Ver. 5.1. If you give a look,
you'll notice that I use mixed-language programming, i.e. half
english half italian, nearly no comments. Hope you will
understand it anyway. I've included the source because:
1) you can tailor TO to your needs, made changes, improvement,
and so on. If you add *ANY* interesting feature, please send me
a copy.
2) you can just have a look at the code; this can be helpful if
you are studying C. I remember I've learned *A LOT* about C by
examining other's people programs. If TO can somehow help you,
I'll be happy about it.
What can you do for me? A little thing and a BIG THING.
The little thing is easy: if you like TO, send me a postcard.
I'll be happy knowing that someone is using my little program.
My address is:
Andrea Steffanoni
Via Cherubini, 6
20145 MILANO
-ITALY-
But now the *BIG THING*. If you have programs or ideas, share
them with the others. Sometimes this can be difficult, because
we are used to keep ours ideas for us, after all they are *OURS*
ideas, aren't they? But just think to that: I gave you my only
idea, and now we are two person with an idea each; I didn't lose
mine, but you gained a new one, and that make me feel happy. Be
generous with ideas: they don't cost anything to you but may be
very precious for other people. If *ALL OF US* will share just
one new idea, all of us will gain hundreds of ideas.
Don't worry if your idea is simple or little; just look mine!
Compared with the ideas and programs I've get from the Shareware
Group, mine is absolutely ridiculous. But -who knows?- maybe can
be very appreciated. Your ideas, small or big, may be useful for
someone else. Don't hide them. Remember that sharing is a form
of loving.
Now, with all my love, my *BEST WISHES* to you everybody.
Andrea Steffanoni